package com.chaoyi.dao.mysql;

import com.chaoyi.doman.koreanvideo.KoreanOnlineVideoOutput;
import com.chaoyi.doman.koreanvideo.KoreanVideoClassificationQueryCondition;
import com.chaoyi.doman.koreanvideo.KoreanVideoDetailOutput;
import com.chaoyi.doman.koreanvideo.KoreanVideoOutput;
import com.chaoyi.model.KoreanVideo;
import com.chaoyi.model.KoreanVideoDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author xuanqicheng
 * @create 2018-10-下午2:05
 */
public interface KoreanVideoMapper {
    /**
     * 添加
     *
     * @param entity
     * @return
     */
    int addVideoSave(@Param(value = "obj") KoreanVideo entity);

    /**
     * 查询总条数
     *
     * @return
     * @param koreanVideo
     */
    int findCount(@Param(value = "obj") KoreanVideo koreanVideo);

    /**
     * 查询分页
     *
     * @param offset
     * @param limit
     * @param koreanVideo
     * @return
     */
    List<KoreanVideo> findList(@Param(value = "pageStat") int offset, @Param(value = "pageStop") int limit,
                               @Param(value = "obj") KoreanVideo koreanVideo);

    /**
     * 查询一条数据
     *
     * @param id
     * @return
     */
    KoreanVideo findVideoOne(int id);

    /**
     * 修改
     *
     * @param entity
     * @return
     */
    int edit(@Param(value = "obj") KoreanVideo entity);

    /**
     * 查询电影分类
     *
     * @param offset
     * @param pageSize
     * @param koreanVideoClassificationQueryCondition
     * @return
     */
    List<KoreanVideoOutput> getVideoClassificationList(@Param(value = "pageStat") int offset,
                                                       @Param(value = "pageStop") int pageSize,
                                                       @Param(value = "obj") KoreanVideoClassificationQueryCondition koreanVideoClassificationQueryCondition);

    /**
     * 查询韩国在线电影列表
     * @param offset
     * @param pageSize
     * @return
     */
    List<KoreanOnlineVideoOutput> getKoreanOnlineVideoList(@Param(value = "pageStat") int offset,
                                                           @Param(value = "pageStop") int pageSize);

    /**
     * 查看正片地址
     * @param id
     * @return
     */
    String getSee(@Param(value = "id") String id);

    /**
     * 查看试看地址
     * @param id
     * @return
     */
    String getTryToSee(@Param(value = "id") String id);

    /**
     * 查询视频详细信息
     * @param id
     * @return
     */
    KoreanVideoDetail selectKoreanVideoDetailById(@Param(value = "id") int id);

    int saveDetail(@Param(value = "obj") KoreanVideoDetail entity);

    int editDetail(@Param(value = "obj") KoreanVideoDetail entity);

    KoreanVideoDetailOutput getDetail(@Param(value = "id") String id);
}
